import request from '@/router/axios'

// 分页查询供应商列表
export function fetchSupplyList(query) {
  return request({
    url: '/eims/supply/page',
    method: 'get',
    params: query
  })
}

// 供应商新增
export function addSupplyObj(obj) {
  return request({
    url: '/eims/supply',
    method: 'post',
    data: obj
  })
}

// 按ID查询供应商
export function getSupplyObj(id) {
  return request({
    url: '/eims/supply/' + id,
    method: 'get'
  })
}

// 供应商删除
export function delSupplyObj(id) {
  return request({
    url: '/eims/supply/' + id,
    method: 'delete'
  })
}

// 供应商启用/停用
export function putSupplyObj(obj) {
  return request({
    url: '/eims/supply',
    method: 'put',
    data: obj
  })
}

// 供应商信息修改
export function updateSupplyObj(obj) {
  return request({
    url: '/eims/supply/updateSupplyCtgById',
    method: 'put',
    data: obj
  })
}

// 委外订单供应商
export function getAllConsignSupply(reorderFlag) {
  return request({
    url: '/eims/supply/getAllConsignSupply/'+reorderFlag,
    method: 'get'
  })
}

//  根据ids获取制造商集合
export function getSupplyListByIds(ids) {
  return request({
    url: '/eims/supply/getListByIds',
    method: 'get',
    params: ids
  })
}
